import React from 'react'
import Children from './Children'
export default function parents() {
        const [count,setCount]=React.useState(0)

        const [user,setUser]=React.useState({name:'张三'})
    function changCount(){
        setCount(s=>s+1)
    }
   
    const callbackName=React.useCallback((userName)=>{

         user.name=userName
        setUser({...user})

    },[])
    


  return (


    <div>parents 
            {count} 
            <button onClick={changCount}>按钮</button>
         
        
        <Children user={user} callback={callbackName}></Children></div>
  )
}
